<%@ page language="java" contentType="text/html;charset=UTF-8"
   	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<LINK REL="SHORTCUT ICON" HREF="images/icon.jpg"> 
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body>
	<form action="search_videos.html" method="post">
	<table cellpadding="0" width="690" cellspacing="0" border="0" align="center">
	<c:forEach var="i" begin="0" end="${fn:length(course)-1 }" step="1" varStatus ="status">
		<tr valign="top">
			<td align="left" colspan="4" style="padding-left: 5px; padding-right:5px; font-size: 14px;">
				<b style=""><c:out value="${course[i].COURSE_NAME}"></c:out></b>
			</td>
		</tr>
		<tr><td height="8"> </td></tr>
		<tr valign="top">
			<td align="left" colspan="4" style="padding-left: 5px; padding-right:5px;font-size: 11px; line-height: 15px;">
				<c:out value="${course[i].COURSE_DESC}"></c:out>
			</td>
		</tr>
		<tr><td height="8"> </td></tr>
		<c:if test="${fn:length(course[i].INSTRUCTION_DESC)>0}">
			<tr valign="top">
				<td align="left" colspan="4" style="padding-left: 5px; padding-right:5px;"><u>សេចក្តីណែនាំ</u></td>
			</tr>	
			<tr><td height="8"> </td></tr>
			<tr valign="top">
				<td align="left" colspan="4" style="padding-left: 5px; padding-right:5px; font-size: 11px; line-height: 15px;">
					<c:out value="${course[i].INSTRUCTION_DESC}"></c:out>
				</td>
			</tr>
		</c:if>
		<tr><td height="8"> </td></tr>
	</c:forEach>
	<c:if test="${fn:length(instruction)>0}">
			<tr valign="top">
				<td align="left" colspan="4" style="padding-left: 5px; padding-right:5px; font-size: 11px; line-height: 15px;">
					ឯកសារភ្ជាប់ :
					<c:forEach var="i" begin="0" end="${fn:length(instruction)-1}" step="1" varStatus ="status">
						<c:if test="${i<fn:length(instruction)-1}">
							<a href="${ServerURL}Learning_Files/Courses/Instructions/${instruction[i].FILE_NAME}"><c:out value="${instruction[i].FILE_NAME}"></c:out></a> &nbsp;<span style="color: #BBB;">|</span>&nbsp;
						</c:if>
						<c:if test="${i==fn:length(instruction)-1}">
							<a href="${ServerURL}Learning_Files/Courses/Instructions/${instruction[i].FILE_NAME}"><c:out value="${instruction[i].FILE_NAME}"></c:out></a>
						</c:if>
						
					</c:forEach>
				</td>
			</tr>
			<tr><td height="8"> </td></tr>
	</c:if>
			<tr><td height="8"> </td></tr>
			<c:if test="${fn:length(VideoList)>0}">
				<tr valign="top">
					<td valign="middle" align="left" colspan="4" style="padding-left:5px; padding-right:5px;">
						<table cellpadding="0" cellspacing="0" border="0">
							<tr>
								<td><img src="images/video_icon.png" align="middle" />&nbsp;</td>
								<td><u>ឯកសារជាវីដេអូ</u>&nbsp;(${fn:length(VideoList)})</td>
							</tr>
						</table>	
					</td>
				</tr>
				<tr><td height="20"> </td></tr>
				<c:forEach var="i" begin="0" end="${fn:length(VideoList)-1}" step="1" varStatus ="status">
				<tr valign="top">
					<td align="left" colspan="4" style="padding-left:5px; padding-right:5px;">
						<table cellpadding="0" cellspacing="0" border="0">
							<tr>
								<td width="15"> </td>
								<td><a href="play_course_video.html?video_id=${VideoList[i].FILE_ID}"><img width="150" src="${VideoList[i].FILE_PATH}Videos/Images/${VideoList[i].IMAGE_FILE}"></a></td>
								<td valign="top" style="padding-left:10px; padding-right:5px;"><a href="play_course_video.html?video_id=${VideoList[i].FILE_ID}"><span style="font-weight: bold;">${VideoList[i].FILE_TITLE}</span></a>
								<br/>
								<label style="font-size: 11px; line-height: 15px;">
								<c:choose>
									<c:when test="${fn:length(VideoList[i].FILE_DESC)>=350}">
										<c:out value="${fn:substring(VideoList[i].FILE_DESC,0,350)}"/>...
									</c:when>
									<c:otherwise>
										<c:out value="${VideoList[i].FILE_DESC}"/>
									</c:otherwise>
								</c:choose>
								<br/><span style="font-size: 10px;color: #555; "><b>Source file:</b> <a href="${ServerURL}${VideoList[i].FILE_PATH}Videos/${VideoList[i].FILE_NAME}">${VideoList[i].FILE_NAME}</a></span>
								</label>
								</td>
							</tr>
							<tr><td colspan="3" height="20"> </td></tr>
						</table>
					</td>
				</tr>		
				</c:forEach>	
			</c:if>
			<c:if test="${fn:length(AudioList)>0}">
				<tr valign="top">
					<td valign="middle" align="left" colspan="4" style="padding-left:5px; padding-right:5px;">
						<table cellpadding="0" cellspacing="0" border="0">
							<tr>
								<td><img src="images/audio_icon.png" align="middle" />&nbsp;</td>
								<td><u>ឯកសារជាសំលេង</u>&nbsp;(${fn:length(AudioList)})</td>
							</tr>
						</table>	
					</td>
				</tr>
				<tr><td height="10"> </td></tr>
				<c:forEach var="i" begin="0" end="${fn:length(AudioList)-1}" step="1" varStatus ="status">
				<tr valign="top">
					<td align="left" colspan="4" style="padding-left:5px; padding-right:5px;​line-height: 15px;">
						<table cellpadding="0" cellspacing="0" border="0">
							<tr>
								<td width="15"> </td>
								<td valign="top" style="padding-left:5px; padding-right:5px;font-size: 11px; line-height: 15px;"><a href="play_course_audio.html?audio_id=${AudioList[i].FILE_ID}"><span style="font-weight: bold;">${AudioList[i].FILE_TITLE}</span></a><br/>
								<c:choose>
									<c:when test="${fn:length(AudioList[i].FILE_DESC)>=350}">
										<c:out value="${fn:substring(AudioList[i].FILE_DESC,0,350)}"/>...
									</c:when>
									<c:otherwise>
										<c:out value="${AudioList[i].FILE_DESC}"/>
									</c:otherwise>
								</c:choose>
								<br/><span style="font-size: 10px;color: #555; "><b>Source file:</b> <a href="${ServerURL}${AudioList[i].FILE_PATH}Audios/${AudioList[i].FILE_NAME}">${AudioList[i].FILE_NAME}</a></span>
								</td>
							</tr>
							<tr><td colspan="2" height="15"> </td></tr>
						</table>
					</td>
				</tr>		
				</c:forEach>	
			</c:if>
			<c:if test="${fn:length(TextList)>0}">
				<tr valign="top">
					<td valign="middle" align="left" colspan="4" style="padding-left:5px; padding-right:5px;">
						<table cellpadding="0" cellspacing="0" border="0">
							<tr>
								<td><img src="images/slide_icon.png" align="middle" />&nbsp;</td>
								<td><u>ឯកសារជាអក្សរ</u>&nbsp;(${fn:length(TextList)})</td>
							</tr>
						</table>	
					</td>
				</tr>
				<tr><td height="10"> </td></tr>
				<c:forEach var="i" begin="0" end="${fn:length(TextList)-1}" step="1" varStatus ="status">
				<tr valign="top">
					<td align="left" colspan="4" style="padding-left:5px; padding-right:5px;">
						<table cellpadding="0" cellspacing="0" border="0">
							<tr>
								<td width="15"> </td>
								<td valign="top" style="padding-left:5px; padding-right:5px;"><a href="view_course_detail.html?view_id=${TextList[i].FILE_ID}"><span style="font-weight: bold;">${TextList[i].FILE_TITLE}</span></a><br/>
								<label style="font-size: 11px; line-height: 15px;">
								<c:choose>
									<c:when test="${fn:length(TextList[i].FILE_DESC)>=350}">
										<c:out value="${fn:substring(TextList[i].FILE_DESC,0,350)}"/>...
									</c:when>
									<c:otherwise>
										<c:out value="${TextList[i].FILE_DESC}"/>
									</c:otherwise>
								</c:choose>
								<br/><span style="font-size: 10px;color: #555; "><b>Source file:</b> <a href="${ServerURL}${TextList[i].FILE_PATH}Text/${TextList[i].FILE_NAME}">${TextList[i].FILE_NAME}</a></span>
								</label>
								</td>
							</tr>
							<tr><td colspan="2" height="15"> </td></tr>
						</table>
					</td>
				</tr>		
				</c:forEach>	
			</c:if>
			<c:if test="${fn:length(OtherList)>0}">
				<tr valign="top">
					<td valign="middle" align="left" colspan="4" style="padding-left:5px; padding-right:5px;">
						<table cellpadding="0" cellspacing="0" border="0">
							<tr>
								<td></td>
								<td><u>ឯកសារជាប្រភេទផ្សេងទៀត</u>&nbsp;(${fn:length(OtherList)})</td>
							</tr>
						</table>	
					</td>
				</tr>
				<tr><td height="10"> </td></tr>
				<c:forEach var="i" begin="0" end="${fn:length(OtherList)-1}" step="1" varStatus ="status">
				<tr valign="top">
					<td align="left" colspan="4" style="padding-left:5px; padding-right:5px;">
						<table cellpadding="0" cellspacing="0" border="0">
							<tr>
								<td width="15"> </td>
								<td valign="top" style="padding-left:5px; padding-right:5px;"><a href="view_course_detail.html?view_id=${OtherList[i].FILE_ID}"><span style="font-weight: bold;">${OtherList[i].FILE_TITLE}</span></a><br/>
								<label style="font-size: 11px; line-height: 15px;">
								<c:choose>
									<c:when test="${fn:length(OtherList[i].FILE_DESC)>=350}">
										<c:out value="${fn:substring(OtherList[i].FILE_DESC,0,350)}"/>...
									</c:when>
									<c:otherwise>
										<c:out value="${OtherList[i].FILE_DESC}"/>
									</c:otherwise>
								</c:choose>
								<br/><span style="font-size: 10px;color: #555; "><b>Source file:</b> <a href="${ServerURL}${OtherList[i].FILE_PATH}Others/${OtherList[i].FILE_NAME}">${OtherList[i].FILE_NAME}</a></span>
								</label>
								</td>
							</tr>
							<tr><td colspan="2" height="15"> </td></tr>
						</table>
					</td>
				</tr>		
				</c:forEach>	
			</c:if>
		<tr><td>&nbsp;</td></tr>
</table>
</form>
</body>
</html>